<?php
/* @var $this PostController */
/* @var $model Post */

$this->breadcrumbs=array(
	'Posts'=>array('index'),
	$model->id,
);

$this->menu=array(
	array('label'=>'List Post', 'url'=>array('index')),
	array('label'=>'Create Post', 'url'=>array('create')),
	array('label'=>'Update Post', 'url'=>array('update', 'id'=>$model->id)),
	array('label'=>'Delete Post', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->id),'confirm'=>'Are you sure you want to delete this item?')),
	array('label'=>'Manage Post', 'url'=>array('admin')),
);
?>

<div id="view-post">
	<div class="inner">
		<h1 class="blog-title"><?php echo $model->post_title; ?></h1>
		<div class="blog-meta">
			<span class="blog-author">
				<span style="font-size: 21px;">✍ </span><?php echo $author; ?>
				<!-- <a href="http://demo4leotheme.com/prestashop/leo_gift_shop_demo/en/blog.html?author=1" title="Demo Demo">Demo Demo</a> -->
			</span>
			<span class="blog-created">
				<span style="font-size: 21px; margin-left: 15px;">⌚ </span>
				<?php echo date("H:i d-m-Y", strtotime($model->created)); ?>
			</span>
			<span class="blog-cat"> 
				<span style="font-size: 16px; margin-left: 15px;">✡ </span> <?php echo $group_name; ?>
				<!-- <a href="http://demo4leotheme.com/prestashop/leo_gift_shop_demo/en/blog/sub-category-1-c12.html" title="Sub Category 1">Sub Category 1</a> -->
			</span>
		</div>
		<div id="blogpage" class="blog-detail blog-container">
			<div class="post-content">
				<?php echo $model->post_content; ?>
			</div>
		</div>
		<div class="social-share">
			<div class="linkedin-twitter">
				<?php
					$this->widget('application.extensions.SocialShareButton.SocialShareButton', array(
				        'style'=>'horizontal',
				        'networks' => array('linkedin','twitter'),
				        'data_via'=>'hungnup', //twitter username (for twitter only, if exists else leave empty)
					));
				?>
			</div>
			<div class="facebook">
				<div id="fb-root"></div>
				<script>(function(d, s, id) {
				  var js, fjs = d.getElementsByTagName(s)[0];
				  if (d.getElementById(id)) return;
				  js = d.createElement(s); js.id = id;
				  js.src = "//connect.facebook.net/vi_VN/sdk.js#xfbml=1&version=v2.0";
				  fjs.parentNode.insertBefore(js, fjs);
				}(document, 'script', 'facebook-jssdk'));</script>
				<div class="fb-like" data-href="https://www.facebook.com/rembachduong" data-layout="button_count" data-action="like" data-show-faces="false" data-share="true"></div>
			</div>
			<div class="google-plus">
				<!-- Đặt thẻ này vào phần đầu hoặc ngay trước thẻ đóng phần nội dung của bạn. -->
				<script src="https://apis.google.com/js/platform.js" async defer>
				  {lang: 'vi'}
				</script>
				<!-- Đặt thẻ này vào nơi bạn muốn Nút +1 kết xuất. -->
				<div class="g-plusone" data-size="medium" data-annotation="inline" data-width="300" data-href="http://rembachduong.vn"></div>
			</div>
		</div>

		<!-- Related post -->
		<div class="related-post">
			<h3>Bài viết liên quan:</h3>
			<?php 
				if($related_posts) {
					foreach ($related_posts as $key => $value) {
						echo '<h5> ✎	'.CHtml::link($value['post_title'],array('post/'.$value['id']),array('class'=>'title1')).'.</h5>';
					}
				}
			?>
		</div>

		<div class="facebook-comment">
			<div id="fb-root"></div>
			<script>(function(d, s, id) {
			  var js, fjs = d.getElementsByTagName(s)[0];
			  if (d.getElementById(id)) return;
			  js = d.createElement(s); js.id = id;
			  js.src = "//connect.facebook.net/vi_VN/sdk.js#xfbml=1&version=v2.0";
			  fjs.parentNode.insertBefore(js, fjs);
			}(document, 'script', 'facebook-jssdk'));</script>
			<div class="fb-comments" data-href="http://localhost/thanhshop/index.php"<?php echo '/post/'.$model->id; ?> data-width="810" data-numposts="7" data-colorscheme="light"></div>
		</div>
	</div>
</div>



<?php
// $this->widget('zii.widgets.CDetailView', array(
// 	'data'=>$model,
// 	'attributes'=>array(
// 		'id',
// 		'post_author',
// 		'post_title',
// 		'post_content',
// 		'group_id',
// 		'featured',
// 		'created',
// 		'modified',
// 	),
// )); ?>
